<template>
  <div>
    <ComponentsTest01 ref="componentsTest01"></ComponentsTest01>
    <button @click="callLogMsg">print once</button>
  </div>
</template>

<script setup lang="ts">
import { ref } from 'vue'
import ComponentsTest01 from './components/ComponentsTest01.vue'

const componentsTest01 = ref<InstanceType<typeof ComponentsTest01> | null>(null)

const callLogMsg = () => {
  console.log(componentsTest01.value?.message)
  componentsTest01.value?.logMessage()
}
</script>
